import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect: '/login'
    },

    {
      path: '/cropper',
      component: resolve => require(['pages/edit/cropper'], resolve)
    },

    {
      path: '/login',
      component: resolve => require(['pages/login'], resolve)
    },
    {
      path: '/register',
      component: resolve => require(['pages/register'], resolve)
    },
    {
      path: '/forgot',
      component: resolve => require(['pages/forgot'], resolve)
    },
    {
      path: '/index',
      component: resolve => require(['pages/index'], resolve)
    },

    {
      path: '/edit',
      component: resolve => require(['pages/edit/edit'], resolve)
    },
    {
      path: '/edit/name',
      component: resolve => require(['pages/edit/name'], resolve)
    },
    {
      path: '/edit/sex',
      component: resolve => require(['pages/edit/sex'], resolve)
    },
    {
      path: '/edit/phone',
      component: resolve => require(['pages/edit/phone'], resolve)
    },
    {
      path: '/edit/newphone',
      component: resolve => require(['pages/edit/new-phone'], resolve)
    },
    {
      path: '/edit/newpassword',
      component: resolve => require(['pages/edit/new-password'], resolve),
    },

    {
      path: '/album/create',
      component: resolve => require(['pages/album/create'], resolve)
    },
    {
      path: '/album/setting',
      component: resolve => require(['pages/album/setting'], resolve)
    },
    {
      path: '/album/basic',
      component: resolve => require(['pages/album/basic'], resolve)
    },
    {
      path: '/album/interaction',
      component: resolve => require(['pages/album/interaction'], resolve)
    },
    {
      path: '/album/privacy',
      component: resolve => require(['pages/album/privacy'], resolve)
    },
    {
      path: '/album/photographer',
      component: resolve => require(['pages/album/photographer'], resolve)
    },
    {
      path: '/album/startupPage',
      component: resolve => require(['pages/album/startupPage'], resolve)
    },
    {
      path: '/album/publicity',
      component: resolve => require(['pages/album/publicity'], resolve)
    },
    {
      path: '/album/publicity/publicityMap',
      component: resolve => require(['pages/album/publicityMap'], resolve)
    },
    {
      path: '/album/retoucher',
      component: resolve => require(['pages/album/retoucher'], resolve)
    },

    {
      path: '/album-set/create',
      component: resolve => require(['pages/album-set/create'], resolve)
    },
    {
      path: '/service',
      component: resolve => require(['pages/service/service'], resolve)
    },
    {
      path: '/service/introduction',
      component: resolve => require(['pages/service/introduction'], resolve)
    },
    {
      path: '/service/operation',
      component: resolve => require(['pages/service/operation'], resolve)
    },
    {
      path: '/service/purchase',
      component: resolve => require(['pages/service/purchase'], resolve)
    },
    {
      path: '/service/contacts',
      component: resolve => require(['pages/service/contacts'], resolve)
    },
    {
      path: '/case',
      component: resolve => require(['pages/case/case'], resolve)
    },
    {
      path: '/case/caseDetail',
      component: resolve => require(['pages/case/caseDetail'], resolve)
    },
    {
      path: '/ceshi',
      component: resolve => require(['pages/ceshi'], resolve)
    },
  ]
})

Router.prototype.goBack = function () {
  this.isBack = true
  window.history.go(-1)
}
